﻿
//打开新增专项计划的页面
function addzxjh()
{
  var sPath;
  var iX=640;
  var iY=480;   
  
  sPath = "/PubProject/Project/Xmxx_ZxPlanSet_Edit.aspx?mode=1&projguid=" + __projguid.value + "&funcid=" + __funcid.value;	
  openMyWin(sPath,"",iX,iY);
}

//打开编辑页面
function modezxjh()
{
  var sPath;
  var iX=640;
  var iY=480;
  
  var arrTr=appGrid.frameElement.getSelected();
  if(!arrTr) return;
  
  var oid=arrTr[0].oid;
  sPath="Xmxx_ZxPlanSet_Edit.aspx?mode=2&oid="+escape(oid)+"&projguid="+__projguid.value+"&funcid="+__funcid.value; 

  openMyWin(sPath,"",iX,iY);
}


//删除选择的专项计划
function delzxjh()
{
  var arrTr,oid;
  var strReturn;

  arrTr = appGrid.frameElement.getSelected();
  if (!arrTr) return;
  oid = arrTr[0].oid;
  strReturn = GetDataFromXMLHTTP("/PubProject/Project/Project_XMLHTTP.aspx?oid=" + escape(oid), "BeforeDeleteZxjh");
  if(strReturn=="OK")
  { 
      if(window.confirm("是否删除该专项计划？")!=true)return;
     
      strReturn = GetDataFromXMLHTTP("/PubProject/Project/Project_XMLHTTP.aspx?oid=" + escape(oid),"Zxjh_DEL" );
      if (strReturn == "NOPASS")
      {
          alert("删除失败！");
          return;
      }
      else
      {
          _Query();
      }
  }
  else if(strReturn=="NO")
  {
      alert("当前专项计划下已编制了计划，不允许删除！");
  }  
}

// 触发查询事件
function _Query()
{
	appGrid.frameElement.Query();
}
		



